<template>
	<view>
		<baseHead title="企业地址" bg="#ffffff" color="#000000"></baseHead>
		<scroll-view scroll-y :style="{'height':windowHeight-customBarH+'px'}" class="scrollCla">
			<view class="listCla" v-for="(item,index) in listdata.Address" :key="index" @click="AddressClick(item)">
				<view class="listClaLeft">
					{{item.Address}}
				</view>
				<image class="listClaRight" src="/static/image/my/dibiao.png" mode=""></image>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import baseHead from "@/pages/component/baseHead.vue";
	export default {
		data() {
			return {
				statusBarH: 0, //状态栏高度
				customBarH: 0, //导航栏高度
				windowWidth: 0, //窗口宽度
				windowHeight: 0, //窗口高度
				listdata: {},
			}
		},
		components: {
			baseHead,
		},
		onLoad(options) {
			this.listdata = JSON.parse(decodeURIComponent(options.params))
		},
		created() {
			const app = getApp()
			// 获取状态栏和导航条高度 窗口宽度
			this.statusBarH = app.globalData.statusBarH;
			this.customBarH = app.globalData.customBarH;
			this.windowWidth = app.globalData.phoneInformation.windowWidth;
			this.windowHeight = app.globalData.phoneInformation.windowHeight;
		},
		methods: {
			AddressClick(item) {
				console.log(item)
				let that = this;
				uni.openLocation({
					latitude: Number(item.Latitude),
					longitude: Number(item.Longitude),
					scale: 10,
					name: item.Address,
					success: function() {
						console.log('success');
					},
					fail: function(e) {
						console.log(e);
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.scrollCla {
		background-color: #ffffff;

		.listCla {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: 30rpx 40rpx 60rpx 40rpx;

			.listClaLeft {
				font-size: 28rpx;
				font-weight: 400;
				color: #000000;
				width: 90%;
			}

			.listClaRight {
				width: 23rpx;
				height: 28rpx;
			}
		}
	}
</style>